From: Felix Fietkau Date: Sun, 21 Sep 2025 09:44:41 +0000 (+0200) Subject: udebug-cli: ignore zero-length messages in logstream X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=d3be5474f6e6b75544e72c8e1a308a4a8f6102c6;p=project%2Fudebug.git udebug-cli: ignore zero-length messages in logstream Prevents stopping the stream when encountering these messages Signed-off-by: Felix Fietkau --- diff --git a/udebug-cli b/udebug-cli index 1f59684..1598643 100755 --- a/udebug-cli +++ b/udebug-cli @@ -188,6 +188,8 @@ function poll_data() { if (length(data) > 0) { if (log_out) { udebug.foreach_packet(data, (entry, data, timestamp) => { + if (!length(data)) + return; if ((opts.timestamp && !log_out.write(sprintf("[%.6f] ", timestamp / 1000000.0))) || !log_out.write(data) || !log_out.write("\n")) uloop.end();